//
//  SuccessCaseViewController.m
//  yonghu
//
//  Created by mac on 2018/5/24.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "SuccessCaseViewController.h"
#import "SuccessCaseView.h"
#import "souSuoViewController.h"
@interface SuccessCaseViewController ()
@property(nonatomic,strong)SuccessCaseView *aView;
@end

@implementation SuccessCaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"成功案例";
    
    UIBarButtonItem *pulishButton=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"搜索"] style:UIBarButtonItemStylePlain target:self action:@selector(souSuo)];
    
    [self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:pulishButton,nil]];
    
    _aView=[SuccessCaseView new];
    [self.view addSubview:_aView];
    [_aView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    _aView.dataArr=[NSMutableArray arrayWithCapacity:0];
    _aView.viewController=self;
    _aView.page=@1;
    [self loginView];
}
-(void)loginView{
    NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:@"0",@"ct_id",@"全部",@"ct_name", nil];
    [ZQTools AFNPostDataUrl:@"api/index/case_type" Dict:dic andTableView:nil andViewController:self andSuccessBlock:^(id responseObject) {

        NSMutableArray *typeArr=[NSMutableArray arrayWithCapacity:0];
        [typeArr addObject:dic];
        [typeArr addObjectsFromArray:responseObject];
        _aView.titleArr=typeArr;
        [_aView creatView];

    } anderrorBlock:nil];
}


-(void)souSuo{

    souSuoViewController *souSuo=[[souSuoViewController alloc] init];
    souSuo.abc=5;
    [ZQTools pushNextViewController:self  andRootController:souSuo];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
